﻿/*************************************************
作者: Plane
邮箱: 1785275942@qq.com
功能: 关卡切换进度显示

           ~~获取更多教学资讯~~
//----------------*----------------\\
        教学官网：www.qiqiker.com
        官方微信服务号: qiqikertuts
        Plane老师微信: PlaneZhong
\\----------------*----------------//
*************************************************/

using UnityEngine.UI;

class LoadingWnd : WindowRoot {
    public Image imgProgress;
    public Text txtProgress;

    protected override void InitWnd() {
        base.InitWnd();

        imgProgress.fillAmount = 0;
        txtProgress.text = "0%";
    }
    protected override void UnInitWnd() {
        base.UnInitWnd();
        imgProgress.fillAmount = 0;
        txtProgress.text = "0%";
    }

    public void SetProgress(int pct, bool state = true) {
        SetWindowState(state);
        imgProgress.fillAmount = pct * 1.0f / 100;
        txtProgress.text = $"{pct}%";
    }
}